﻿<!DOCTYPE html >
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title>登录</title>
<link href="./public/css/bootstrap.min_1.css" rel="stylesheet" type="text/css"/>
<link href="./public/css/login_1.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  
  <div style="height:1px;"></div>
  <div class="login">
     <header>
	    <h1>登录</h1>
	 </header>
	 <div class="sr">
			<div class="name">
				<label>
				<i class="sublist-icon glyphicon glyphicon-user"></i>
				</label>
			  <input id="user" type="text" class="form-control name_inp" placeholder="登录名" aria-describedby="basic-addon1">
			</div>
			 <div class="name">
				<label>
				<i class="sublist-icon glyphicon glyphicon-pencil"></i>
				</label>
				<input id="pass" type="password"  placeholder="这里输入登录密码" class="name_inp">
			</div>
			<button class="dl" type="submit">登录</button>
	 </div>
  </div>
<div style="text-align:center;">
</div>
<script src="./public/js/tongji_2.js"></script>
<script src="./public/js/youxia_2.js" type="text/javascript"></script>
<script type="text/javascript"  src="./public/js/su_2.js"></script>
<script src="./public/js/jquery-2.1.0.js"></script>
<script>
	$(function(){
		//用户
		// $("#user").focus(function(){
		// 	$("#user").css({
		// 		border:"1px solid #80BEF0",
		// 		boxShadow : "0px 1px 13px #80BEF0"
		// 	})
		// }).blur(function(){
		// 	$("#user").css({
		// 		border:"0",
		// 		boxShadow : "0px 0px 0px #fff"
		// 	})
		// })
		// //密码
		// $("#pass").focus(function(){
		// 	$("#pass").css({
		// 		border:"1px solid #80BEF0",
		// 		boxShadow : "0px 1px 13px #80BEF0"
		// 	})
		// }).blur(function(){
		// 	$("#pass").css({	
		// 		border:"0",
		// 		boxShadow : "0px 0px 0px #fff"
		// 	});	
		// })
		
		//登录
		$(".dl").click(function(){
			var user=$('#user').val();
			var pass=$('#pass').val();
			if(user==''){
				alert('账号不能为空');
				return false;
			}
			if(pass==''){
				alert('密码不能为空');
				return false;
			}
			$.post("{:U('Login/login')}",
				{user:user,pwd:pass},
				function(res){
					console.log(res);
					if(res.code==10000){
						alert(res.msg);
						window.location.href="{:U('Index/index')}";
					}else{
						alert(res.msg);
					}
				}



				)

			// window.location.href='index.html';
		});
	})
</script>
</body>
</html>
